import * as actionType from './constants.js'
import { reqDetail } from '@/api/index.js'

export { setTabbarDisplay } from '../../home/store/actionCreators.js'

export const setDetailData=(data)=>{
    return {
        type:actionType.SET_DETAIL_DATA,
        data
    }
}

export const getDetailData=(id)=>{
    return (dispatch)=>{
        reqDetail(id)
            .then(res=>{
                dispatch(setDetailData(res.data.data.goodsDetailData))

        })
    }
}